class Solution(object):
    def __init__(self):
        self.unit = ["", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine"]
        self.tens = ["Ten", "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen", "Nineteen"]
        self.ten = ["lalala", "Ten", "Twenty", "Thirty", "Forty", "Fifty", "Sixty", "Seventy", "Eighty", "Ninety"]
    def numberToWords(self, num):
        """
        :type num: int
        :rtype: str
        """

        def transUnit(num):
            return [self.unit[num]] if num!=0 else []

        def transTen(num):
            if num//10==0:
                return transUnit(num)
            elif num//10==1:
                return [self.tens[num%10]]
            else:
                return [self.ten[num//10]] + transUnit(num%10)

        def transHundred(num):
            if num//100==0:
                return transTen(num)
            else:
                return transUnit(num//100) + ["Hundred"] + transTen(num%100)
        
        def transThousand(num):
            if num//1000==0:
                return transHundred(num)
            else:
                return transHundred(num//1000) + ["Thousand"] + transHundred(num%1000)
        
        def transMillion(num):
            if num//1000000==0:
                return transThousand(num)
            else:
                return transThousand(num//1000000) + ["Million"] + transThousand(num%1000000)
        
        def transBillion(num):
            if num//1000000000==0:
                return transMillion(num)
            else:
                return transThousand(num//1000000000) + ["Billion"] + transMillion(num%1000000000)
        
        final = transBillion(num) if num!=0 else ["Zero"]
        for i in range(len(final)):
            if i != len(final)-1:
                final[i] = final[i] + " "
        return "".join(final)

print(Solution().numberToWords(1234567890))